package com.wiringweb.servlet;

import com.wiringweb.http.HttpMethod;
import com.wiringweb.parameterprocessor.ParameterProcessorInterface;
import java.lang.reflect.Method;
import java.util.regex.Pattern;

/**
 * @author Dmitry
 */
public class UrlBind {
    private HttpMethod httpMethod;
    private Pattern matcher;
    private BaseWiringWebController controller;
    private Method method;
    private ParameterProcessorInterface[] parameterProcessors;

    public ParameterProcessorInterface[] getParameterProcessors() {
        return parameterProcessors;
    }

    public void setParameterProcessors(ParameterProcessorInterface[] parameterProcessors) {
        this.parameterProcessors = parameterProcessors;
    }

    public HttpMethod getHttpMethod() {
        return httpMethod;
    }

    public void setHttpMethod(HttpMethod httpMethod) {
        this.httpMethod = httpMethod;
    }

    public BaseWiringWebController getController() {
        return controller;
    }

    public void setController(BaseWiringWebController controller) {
        this.controller = controller;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getMatcher() {
        return matcher;
    }

    public void setMatcher(Pattern matcher) {
        this.matcher = matcher;
    }

    @Override
    public String toString() {
        return httpMethod + ". " + matcher.pattern() + ". Method=" + method.getName();
    }

}
